package com.zpb.framework.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zpb.framework.domain.ApiResult;
import com.zpb.framework.domain.dto.ArticleAddDto;
import com.zpb.framework.domain.dto.ArticleEditDto;
import com.zpb.framework.domain.dto.ArticleQueryDto;
import com.zpb.framework.domain.entity.Article;
import com.zpb.framework.domain.entity.ArticleDetailVo;
import com.zpb.framework.domain.vo.ArticleEditVo;
import com.zpb.framework.domain.vo.HotArticleVo;
import com.zpb.framework.domain.vo.PageVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description:
 * @Author: zhaopengbo
 * @Date: 2025/9/7
 */
public interface ArticleService extends IService<Article> {
    ApiResult<List<HotArticleVo>> getHotArticleList();

    ApiResult<PageVo> getListByCondition(Integer pageNum, Integer pageSize, Article article);

    ApiResult<ArticleDetailVo> getDetailById(Long id);

    ApiResult addViewCount(Long articleId);

    ApiResult addArticle(ArticleAddDto articleAddDto);

    ApiResult<PageVo> getArticleListByCondition(Integer pageNum, Integer pageSize, ArticleQueryDto articleQueryDto);

    ApiResult<ArticleEditVo> getArticleById(Long id);

    ApiResult updateArticleById(ArticleEditDto articleEditDto);

    @Transactional
    ApiResult deleteArticleById(Long id);
}
